package cat.ecorder;
import android.content.Intent;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;


public class MenuEcorder extends Activity implements OnClickListener{
    ImageButton ibQui;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.menu_ecorder);
        ImageButton btQui = (ImageButton)findViewById(R.id.ibQui);
        ImageButton btQue = (ImageButton)findViewById(R.id.ibQue);
        ImageButton btOn = (ImageButton)findViewById(R.id.ibOn);
        ImageButton btProducte = (ImageButton)findViewById(R.id.ibProducte);
        ImageButton btContactans = (ImageButton)findViewById(R.id.ibContactans);
        btQui.setOnClickListener(this);
        btQue.setOnClickListener(this);
        btOn.setOnClickListener(this);
        btProducte.setOnClickListener(this);
        btContactans.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent intent;
        switch(v.getId())
        {
            case R.id.ibQui: {
                intent = new Intent("cat.ecorder.Qui");
                startActivity(intent);
                break;
            }
            case R.id.ibQue:   {
                intent = new Intent("cat.ecorder.Que");
                startActivity(intent);
                break;
            }

            case R.id.ibOn: {
            	intent = new Intent("cat.ecorder.On");
                startActivity(intent);
                break;

            }
            case R.id.ibProducte: {
                intent = new Intent("cat.ecorder.Productes");
                startActivity(intent);
                break;
            }
            case R.id.ibContactans: {
                intent = new Intent("cat.ecorder.Contactans");
                startActivity(intent);
                break;
            }
        }

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_ecorder, menu);
        return true;
    }
    
}
